﻿<cfsilent>
	<cfscript>
		
		dictAdvice = getProperty("serviceFactory").getBean("senateDictionaryAdvice");
		mathAdvice = getProperty("serviceFactory").getBean("senateMathAdvice");
		sessionAdvice = getProperty("serviceFactory").getBean("sessionAdvice");
		
		depId = sessionAdvice.getUserProp("teacherDepartment");
		
		termId = event.getArg("TermID");
		academicYear = event.getArg("AcademicYear");
		academicTerm = event.getArg("AcademicTerm");
		
		currentTab = event.getArg("TabID", "labSubject");
		
		passArgs = structNew();
		structInsert( passArgs, "TID", termId );
		
		event.setArg("pageTitle", "教学运行管理 - 排课 - 打印行政班课表");
		
		/* 目标班级信息 */
		subjectId = event.getArg("SBJ");
		grade = event.getArg("GRD", year(now()) - 1);
		classId = event.getArg("CLSID");
		
		/* 根据学院 读取招生年级 */
		sql = "	SELECT
					DISTINCT clz.grade
				FROM
					t_class clz
					INNER JOIN t_subject sbj ON clz.sbj_id = sbj.sbj_id
					INNER JOIN t_institute i ON i.institute_id = sbj.institute_id
				WHERE
					i.institute_id = :instituteId 
				ORDER BY
					clz.grade DESC";
		
		queryObj = new Query(datasource = application.dnsSlave);
		queryObj.addParam(name = "instituteId", value = depId, cfsqltype="cf_sql_varchar");
		rs_grade = queryObj.execute(sql = sql).getResult();
		
		/* 根据学院和年级 读取专业开设信息 */
		sql = "	SELECT
					sbj.sbj_id,
					sbj.sbj_name,
					sbj.term_start,
					sbj.level_code,
					lb.learning_branch
				FROM
					t_class clz
					INNER JOIN t_subject sbj ON sbj.sbj_id = clz.sbj_id
					INNER JOIN t_learning_branch lb ON lb.b_id = sbj.b_id
				WHERE
					sbj.institute_id = :instituteId 
					AND
					clz.grade = :grade 
				GROUP BY
					sbj.sbj_id,
					sbj.sbj_name,
					sbj.term_start,
					sbj.level_code,
					lb.learning_branch
				ORDER BY
					sbj.sbj_name";
		
		queryObj = new Query(datasource = application.dnsSlave);
		queryObj.addParam(name = "instituteId", value = depId, cfsqltype="cf_sql_varchar");
		queryObj.addParam(name = "grade", value = grade, cfsqltype="cf_sql_char");
		rs_subject = queryObj.execute(sql = sql).getResult();

		if ( len(subjectId) ) {
			
			currentTab = event.getArg("TabID", "labFormClass");								
										
			/* 根据专业 读取招生年级 */
			sql = "	SELECT
						DISTINCT clz.grade
					FROM
						t_class clz
					WHERE
						clz.sbj_id = :subjectId 
					ORDER BY
						clz.grade DESC";
			
			queryObj = new Query(datasource = application.dnsSlave);
			queryObj.addParam(name = "subjectId", value = subjectId, cfsqltype="cf_sql_varchar");
			rs_gradeSBJ = queryObj.execute(sql = sql).getResult();
			
			/* 根据专业和年级 读取班级信息 */
			sql = "	SELECT
						clz.cls_id,clz.cls_name,clz.cls_size,clz.cls_scale,c.campus_name
					FROM
						t_class clz
						INNER JOIN t_campus c ON clz.campus_id = c.campus_id
					WHERE
						clz.sbj_id = :subjectId  AND clz.grade = :grade 
					ORDER BY
						clz.cls_name";
						
			queryObj = new Query(datasource = application.dnsSlave);
			queryObj.addParam(name = "subjectId", value = subjectId, cfsqltype="cf_sql_varchar");
			queryObj.addParam(name = "grade", value = grade, cfsqltype="cf_sql_char");
			rs_clazz = queryObj.execute(sql = sql).getResult();
			
		} 
		
		if ( len(classId) ) {
			
			currentTab = event.getArg("TabID", "labCourseTable");
			
			/* 读取班级学生课表 */
			sql = "	SELECT
						DISTINCT 
						c.course_name,
						a.tasktime,
						CASE WHEN a.taskclsroom IS NULL THEN '-' ELSE a.taskclsroom END taskclsroom,
						a.task_week,
						ta.task_type,ta.task_id
					FROM
						t_task_timetable a
						INNER JOIN t_task_arrange ta ON ta.task_id = a.task_id
						INNER JOIN t_course c ON c.cid = ta.cid
					WHERE
						EXISTS(
							SELECT
								0
							FROM
								t_student_course b
								INNER JOIN t_student stu ON b.stu_id = stu.stu_id
							WHERE
								ta.task_id = b.task_id
								AND
								ta.term_id = :termId 
								AND
								stu.cls_id = :classId 
								AND
								b.st = 'N'
								AND
								b.task_type = 'P'
						)";
			
			queryObj = new Query(datasource = application.dnsSlave);
			queryObj.addParam(name = "termId", value = termId, cfsqltype="cf_sql_char");
			queryObj.addParam(name = "classId", value = classId, cfsqltype="cf_sql_char");
			rs_tableData = queryObj.execute(sql = sql).getResult();
			

			
			timeTable = arrayNew(2);
		
			/* 课表冲突标记 */
			for ( lec=1; lec lte 6; lec++ ) {
				for ( wkday=1; wkday lte 7; wkday++ ) {
					timeTable[wkday][lec] = 0;
				}
			}
			
			timeTableSet = structNew();
			
			/* 生成课表显示数据 */
			for(a = 1; a LTE rs_tableData.recordCount; a++){
			
				currentTaskTime = rs_tableData['tasktime'][a];
			
				if ( rs_tableData['taskclsroom'][a] eq "-" ) { 
					currentTaskPlace = "";
				}
				else {
					currentTaskPlace = rs_tableData['taskclsroom'][a];
				}
			
				wkday = listGetAt(currentTaskTime, 1, "-@");
				lec = listGetAt(currentTaskTime, 2, "-@");
				cell = listGetAt(currentTaskTime, 3, "-@");
			
				/* 载入教学任务 */
				switch(rs_tableData['task_type'][a]){
					
					case 'P':
						sql = "	SELECT
									tch.tch_name,tch_sec.tch_name tch_name_sec,tch_ace.tch_name tch_name_ace
								FROM
									t_task t
									INNER JOIN t_teacher tch ON t.tch_id = tch.tch_id
									INNER JOIN t_teacher tch_sec ON t.tch_id_sec = tch_sec.tch_id
									INNER JOIN t_teacher tch_ace ON t.tch_id_ace = tch_ace.tch_id
								WHERE
									t.tsk_id = :taskId ";
						queryObj = new Query(datasource = application.dnsSlave);
						queryObj.addParam(name = "taskId", value = rs_tableData['task_id'][a], cfsqltype="cf_sql_varchar");
						rs_taskEntity = queryObj.execute(sql = sql).getResult();
						break;
					case 'C':
						sql = "	SELECT
									tch.tch_name,tch_sec.tch_name tch_name_sec,tch_ace.tch_name tch_name_ace
								FROM
									t_common_task t
									INNER JOIN t_teacher tch ON t.tch_id = tch.tch_id
									INNER JOIN t_teacher tch_sec ON t.tch_id_sec = tch_sec.tch_id
									INNER JOIN t_teacher tch_ace ON t.tch_id_ace = tch_ace.tch_id
								WHERE
									t.tsk_id = :taskId ";
						queryObj = new Query(datasource = application.dnsSlave);
						queryObj.addParam(name = "taskId", value = rs_tableData['task_id'][a], cfsqltype="cf_sql_varchar");
						rs_taskEntity = queryObj.execute(sql = sql).getResult();
						break;
					case 'R':
						sql = "	SELECT
									tch.tch_name,tch_sec.tch_name tch_name_sec,tch_ace.tch_name tch_name_ace
								FROM
									t_reopen_task t
									INNER JOIN t_teacher tch ON t.tch_id = tch.tch_id
									INNER JOIN t_teacher tch_sec ON t.tch_id_sec = tch_sec.tch_id
									INNER JOIN t_teacher tch_ace ON t.tch_id_ace = tch_ace.tch_id
								WHERE
									t.tsk_id = :taskId ";
						queryObj = new Query(datasource = application.dnsSlave);
						queryObj.addParam(name = "taskId", value = rs_tableData['task_id'][a], cfsqltype="cf_sql_varchar");
						rs_taskEntity = queryObj.execute(sql = sql).getResult();
						break;
					case 'T':
						sql = "	SELECT
									tch.tch_name,tch_sec.tch_name tch_name_sec,tch_ace.tch_name tch_name_ace
								FROM
									t_sport_task t
									INNER JOIN t_teacher tch ON t.tch_id = tch.tch_id
									INNER JOIN t_teacher tch_sec ON t.tch_id_sec = tch_sec.tch_id
									INNER JOIN t_teacher tch_ace ON t.tch_id_ace = tch_ace.tch_id
								WHERE
									t.tsk_id = :taskId ";
						queryObj = new Query(datasource = application.dnsSlave);
						queryObj.addParam(name = "taskId", value = rs_tableData['task_id'][a], cfsqltype="cf_sql_varchar");
						rs_taskEntity = queryObj.execute(sql = sql).getResult();
						break;
				}
			
				/* 生成教师 */
				currentTeacher = rs_taskEntity.tch_name;
			
				if ( not listFind( currentTeacher, rs_taskEntity.tch_name_sec, "/ " ) ) {
					currentTeacher = currentTeacher & " / " & rs_taskEntity.tch_name_sec;
				}
			
				if ( not listFind( currentTeacher, rs_taskEntity.tch_name_ace, "/ " ) ) {
					currentTeacher = currentTeacher & " / " & rs_taskEntity.tch_name_ace;
				}
			
				/* 
					生成课表内容 
					cellCourse = [ courseName, teacherName, place, cellLength, taskWeek]
				*/
				if ( cell eq 2 ) {

					cellCourse = [ rs_tableData['course_name'][a], currentTeacher, currentTaskPlace, cell, rs_tableData['task_week'][a] ];
			
					lectureKey = "KB" & wkday & lec;
					if ( structKeyExists( timeTableSet, lectureKey ) ) {
				
						/* 计算课表单元时间冲突 */
						for ( cellCourseExists in timeTableSet[lectureKey] ) {
							if ( mathAdvice.isWeekOver( cellCourseExists[5], cellCourse[5] ) ) {
								/* 同一单元格 如果上课周次有重叠 */
								timeTable[wkday][lec] = 1;
							}
						}

						arrayAppend( timeTableSet[lectureKey], cellCourse );
				
					}
					else {
						structInsert( timeTableSet, lectureKey, [cellCourse] );
					}
			
				}
			
				if ( cell eq 3 and lec eq 2 ) {

					cellCourse = [ rs_tableData['course_name'][a], currentTeacher, currentTaskPlace, cell, rs_tableData['task_week'][a] ];
			
					lectureKey = "KB" & wkday & lec;
					if ( structKeyExists( timeTableSet, lectureKey ) ) {
				
						/* 计算课表单元时间冲突 */
						for ( cellCourseExists in timeTableSet[lectureKey] ) {
							if ( mathAdvice.isWeekOver( cellCourseExists[5], cellCourse[5] ) ) {
								/* 同一单元格 如果上课周次有重叠 */
								timeTable[wkday][lec] = 1;
							}
						}

						arrayAppend( timeTableSet[lectureKey], cellCourse );
				
					}
					else {
						structInsert( timeTableSet, lectureKey, [cellCourse] );
					}
			
				}
			
				if ( cell eq 3 and lec eq 5 ) {

					cellCourse = [ rs_tableData['course_name'][a], currentTeacher, currentTaskPlace, 2, rs_tableData['task_week'][a] ];
			
					lectureKey = "KB" & wkday & lec;
					if ( structKeyExists( timeTableSet, lectureKey ) ) {
				
						/* 计算课表单元时间冲突 */
						for ( cellCourseExists in timeTableSet[lectureKey] ) {
							if ( mathAdvice.isWeekOver( cellCourseExists[5], cellCourse[5] ) ) {
								/* 同一单元格 如果上课周次有重叠 */
								timeTable[wkday][lec] = 1;
							}
						}

						arrayAppend( timeTableSet[lectureKey], cellCourse );
				
					}
					else {
						structInsert( timeTableSet, lectureKey, [cellCourse] );
					}
			
					/* 晚上3节延续1学时 */
					cellCourse = [ rs_tableData['course_name'][a], currentTeacher, currentTaskPlace, 1, rs_tableData['task_week'][a] ];
			
					lectureKey = "KB" & wkday & lec+1;
					if ( structKeyExists( timeTableSet, lectureKey ) ) {
				
						/* 计算课表单元时间冲突 */
						for ( cellCourseExists in timeTableSet[lectureKey] ) {
							if ( mathAdvice.isWeekOver( cellCourseExists[5], cellCourse[5] ) ) {
								/* 同一单元格 如果上课周次有重叠 */
								timeTable[wkday][lec+1] = 1;
							}
						}

						arrayAppend( timeTableSet[lectureKey], cellCourse );
				
					}
					else {
						structInsert( timeTableSet, lectureKey, [cellCourse] );
					}
			
				}
			
				/* 4学时延续 */
				if ( cell eq 4 ) {
			
					cellCourse = [ rs_tableData['course_name'][a], currentTeacher, currentTaskPlace, 2, rs_tableData['task_week'][a] ];
			
					lectureKey = "KB" & wkday & lec;
					if ( structKeyExists( timeTableSet, lectureKey ) ) {
				
						/* 计算课表单元时间冲突 */
						for ( cellCourseExists in timeTableSet[lectureKey] ) {
							if ( mathAdvice.isWeekOver( cellCourseExists[5], cellCourse[5] ) ) {
								/* 同一单元格 如果上课周次有重叠 */
								timeTable[wkday][lec] = 1;
							}
						}
					
						arrayAppend( timeTableSet[lectureKey], cellCourse );
					}
					else {
						structInsert( timeTableSet, lectureKey, [cellCourse] );
					}
			
					lectureKey = "KB" & wkday & lec+1;
					if ( structKeyExists( timeTableSet, lectureKey ) ) {
				
						/* 计算课表单元时间冲突 */
						for ( cellCourseExists in timeTableSet[lectureKey] ) {
							if ( mathAdvice.isWeekOver( cellCourseExists[5], cellCourse[5] ) ) {
								/* 同一单元格 如果上课周次有重叠 */
								timeTable[wkday][lec+1] = 1;
							}
						}
				
						arrayAppend( timeTableSet[lectureKey], cellCourse );
					}
					else {
						structInsert( timeTableSet, lectureKey, [cellCourse] );
					}
				}
			
				/* 5学时延续 */
				if ( cell eq 5 ) {
			
					cellCourse = [ rs_tableData['course_name'][a], currentTeacher, currentTaskPlace, 2, rs_tableData['task_week'][a] ];
			
					lectureKey = "KB" & wkday & lec;
					if ( structKeyExists( timeTableSet, lectureKey ) ) {
				
						/* 计算课表单元时间冲突 */
						for ( cellCourseExists in timeTableSet[lectureKey] ) {
							if ( mathAdvice.isWeekOver( cellCourseExists[5], cellCourse[5] ) ) {
								/* 同一单元格 如果上课周次有重叠 */
								timeTable[wkday][lec] = 1;
							}
						}
				
						arrayAppend( timeTableSet[lectureKey], cellCourse );
					}
					else {
						structInsert( timeTableSet, lectureKey, [cellCourse] );
					}

					cellCourse = [ rs_tableData['course_name'][a], currentTeacher, currentTaskPlace, 3, rs_tableData['task_week'][a] ];
			
					lectureKey = "KB" & wkday & lec+1;
					if ( structKeyExists( timeTableSet, lectureKey ) ) {
				
						/* 计算课表单元时间冲突 */
						for ( cellCourseExists in timeTableSet[lectureKey] ) {
							if ( mathAdvice.isWeekOver( cellCourseExists[5], cellCourse[5] ) ) {
								/* 同一单元格 如果上课周次有重叠 */
								timeTable[wkday][lec+1] = 1;
							}
						}
				
						arrayAppend( timeTableSet[lectureKey], cellCourse );
					}
					else {
						structInsert( timeTableSet, lectureKey, [cellCourse] );
					}
				}
			
				/* 8学时延续 */
				if ( cell eq 8 ) {
				
					cellCourse = [ rs_tableData['course_name'][a], currentTeacher, currentTaskPlace, 2, rs_tableData['task_week'][a] ];
				
					lectureKey = "KB" & wkday & lec;
					if ( structKeyExists( timeTableSet, lectureKey ) ) {
					
						/* 计算课表单元时间冲突 */
						for ( cellCourseExists in timeTableSet[lectureKey] ) {
							if ( mathAdvice.isWeekOver( cellCourseExists[5], cellCourse[5] ) ) {
								/* 同一单元格 如果上课周次有重叠 */
								timeTable[wkday][lec] = 1;
							}
						}
					
						arrayAppend( timeTableSet[lectureKey], cellCourse );
					}
					else {
						structInsert( timeTableSet, lectureKey, [cellCourse] );
					}
			
					lectureKey = "KB" & wkday & lec+1;
					if ( structKeyExists( timeTableSet, lectureKey ) ) {
					
						/* 计算课表单元时间冲突 */
						for ( cellCourseExists in timeTableSet[lectureKey] ) {
							if ( mathAdvice.isWeekOver( cellCourseExists[5], cellCourse[5] ) ) {
								/* 同一单元格 如果上课周次有重叠 */
								timeTable[wkday][lec+1] = 1;
							}
						}
				
						arrayAppend( timeTableSet[lectureKey], cellCourse );
					}
					else {
						structInsert( timeTableSet, lectureKey, [cellCourse] );
					}

					lectureKey = "KB" & wkday & lec+2;
					if ( structKeyExists( timeTableSet, lectureKey ) ) {
					
						/* 计算课表单元时间冲突 */
						for ( cellCourseExists in timeTableSet[lectureKey] ) {
							if ( mathAdvice.isWeekOver( cellCourseExists[5], cellCourse[5] ) ) {
								/* 同一单元格 如果上课周次有重叠 */
								timeTable[wkday][lec+2] = 1;
							}
						}
					
						arrayAppend( timeTableSet[lectureKey], cellCourse );
					}
					else {
						structInsert( timeTableSet, lectureKey, [cellCourse] );
					}

					lectureKey = "KB" & wkday & lec+3;
					if ( structKeyExists( timeTableSet, lectureKey ) ) {
				
						/* 计算课表单元时间冲突 */
						for ( cellCourseExists in timeTableSet[lectureKey] ) {
							if ( mathAdvice.isWeekOver( cellCourseExists[5], cellCourse[5] ) ) {
								/* 同一单元格 如果上课周次有重叠 */
								timeTable[wkday][lec+3] = 1;
							}
						}
						
						arrayAppend( timeTableSet[lectureKey], cellCourse );
					}
					else {
						structInsert( timeTableSet, lectureKey, [cellCourse] );
					}

				}

			}
		
		}
									
	</cfscript>
</cfsilent>							
										
<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('teacherCourseTable', passArgs)#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">教师上课情况汇总</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 collection"></i>学期行政班授课安排情况
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="courseTable">
			
				<cfif termId eq "">
					<!-- termSelector -->
					<cfoutput>#event.getArg("termSelector")#</cfoutput>
					<!-- /termSelector -->
				</cfif>
				
				<cfif len(termId)>
					
					<div class="UItab">
						<div class="tabLables">
							<span <cfif currentTab eq "labSubject">class="active"</cfif> id="labSubject" tabTarget="Subject">选择专业</span>
							<cfif len(subjectId)>
								<span <cfif currentTab eq "labFormClass">class="active"</cfif> id="labFormClass" tabTarget="FormClass">选择行政班</span>
							</cfif>
							<cfif len(classId)>
								<span <cfif currentTab eq "labCourseTable">class="active"</cfif> id="labCourseTable" tabTarget="CourseTable">行政班学生课程安排</span>
							</cfif>
						</div>
					</div>
					
					<script language="javascript" type="text/javascript">
						//<![CDATA[
						<!--
						$(document).ready(function() {
					
							/* init Tab */
							$("div.tabContent").hide();
							$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
							$("div.tabLables > span").click(function(){
								var $targetID = $(this).attr("tabTarget");
								
								$("div.tabLables span").removeClass("active");
								$(this).addClass("active");
							
								$("div.tabContent").not('[id="' + $targetID + '"]').hide();
								$("div.tabContent#" + $targetID).show();
							});
						
						});
					
						// -->
						//]]>
					</script>
					
					<div id="Subject" class="tabContent">
						
						<div class="noticeBlock">
							<div class="operation">
                                <cfloop query="rs_grade">
									<cfset structInsert(passArgs, "GRD", rs_grade.grade, true) />
									<a class="uiButton <cfif rs_grade.grade eq grade>uiButtonSpecial</cfif>" href="<cfoutput>#buildURL('classCourseTable', passArgs)#</cfoutput>"><span class="uiButtonText"><cfoutput>#rs_grade.grade#</cfoutput> 级</span></a>
								</cfloop>
								<!--- 将年级回滚为默认值 --->
								<cfset structInsert(passArgs, "GRD", grade, true) />
							</div>
							<h3>选择专业和年级</h3>
							<hr/>
						</div>
						
						<cfif rs_subject.recordCount>
								
								<div class="clearfix">
									<div class="UICardTable">
                                        <cfloop query="rs_subject">
										<cfset structInsert(passArgs, "SBJ", rs_subject.sbj_id, true) />
										<dl <cfif len(subjectId) and subjectId neq rs_subject.sbj_id>class="disabled"</cfif>>
												<dt> 
												<a href="<cfoutput>#buildURL('classCourseTable', passArgs)#</cfoutput>"> <em class="subject"><!--imgholder--></em>
											<dd>
													<h3><cfoutput>#rs_subject.sbj_name#</cfoutput></h3>
													<div><cfoutput>#dictAdvice.getTermEnrol(rs_subject.term_start)#-#dictAdvice.getStudentLevel(rs_subject.level_code)#(#rs_subject.learning_branch#)</cfoutput></div>
												</dd>
											</a>
												</dt>
											</dl>
									</cfloop>
										<!--- 将专业回滚为默认值 --->
										<cfset structInsert(passArgs, "SBJ", subjectId, true) />
									</div>
								</div>
								
							<cfelse>
								<div class="systemNotice">
									<p>该学院在指定年级没有招生专业</p>
								</div>
						</cfif>
					</div>
					
					<cfif len(subjectId)>
					
						<div id="FormClass" class="tabContent">
						
							<div class="noticeBlock">
								<div class="operation">
                                    <cfloop query="rs_gradeSBJ">
										<cfset structInsert(passArgs, "GRD", rs_gradeSBJ.grade, true) />
										<a class="uiButton <cfif rs_gradeSBJ.grade eq grade>uiButtonSpecial</cfif>" href="<cfoutput>#buildURL('classCourseTable', passArgs)#</cfoutput>"><span class="uiButtonText"><cfoutput>#rs_gradeSBJ.grade#</cfoutput> 级</span></a>
									</cfloop>
									<!--- 将年级回滚为默认值 --->
									<cfset structInsert(passArgs, "GRD", grade, true) />
									<cfif rs_clazz.recordCount>
										<a class="uiButton" target="_blank" href="<cfoutput>#buildURL('subjectGradeCoursePrint', passArgs)#</cfoutput>"><i class="mrs img btnPrint"></i><span class="uiButtonText">打印专业课表</span></a>
									</cfif>
								</div>
								<h3>选择行政班</h3>
								<hr/>
							</div>
						
							<cfif rs_clazz.recordCount>
								
									<cfset row = 0 />
									<table class="UIEditable">
										<thead>
											<tr>
												<td width="18"></td>
												<td>班级</td>
												<td width="80">所在校区</td>
												<td width="60" align="center">计划人数</td>
												<td width="40" align="center">学生数</td>
												<td width="18"></td>
											</tr>
										</thead>
										<tbody>
                                            <cfloop query="rs_clazz">
												<cfset structInsert(passArgs, "CLSID", rs_clazz.cls_id, true) />
												<cfset row++ />
												<tr class="editRows <cfif rs_clazz.cls_size lt rs_clazz.cls_scale>noticeRow1</cfif>">
													<td class="index"><cfoutput>#row#</cfoutput></td>
													<td><cfoutput>#rs_clazz.cls_name#</cfoutput></td>
													<td><cfoutput>#rs_clazz.campus_name#</cfoutput></td>
													<td align="center"><span class="numeric"><cfoutput>#rs_clazz.cls_size#</cfoutput></span></td>
													<td align="center"><span class="numeric"><cfoutput>#rs_clazz.cls_scale#</cfoutput></span></td>
													<td><a title="班级课表" class="stat arrange" href="<cfoutput>#buildURL('classCourseTable', passArgs)#</cfoutput>"></a></td>
												</tr>
											</cfloop>
											<!--- 移出班级号参数 --->
											<cfset structDelete( passArgs, "CLSID", false ) />
										</tbody>
									</table>
								
								<cfelse>
								
									<div class="systemNotice">
										<p>该专业在指定年级没有招生</p>
									</div>
								
							</cfif>
						
						</div>
					
					</cfif>
					
					
					<cfif len(classId)>
					
						<div id="CourseTable" class="tabContent">
							
							<div class="noticeBlock">
								<div class="operation">
									<cfset structInsert(passArgs, "CLSID", classId, true) />
									<a class="uiButton" target="_blank" href="<cfoutput>#buildURL('classCoursePrint', passArgs)#</cfoutput>"><i class="mrs img btnPrint"></i><span class="uiButtonText">打印班级课表</span></a>
								</div>
								<h3>行政班课程安排</h3>
								<hr/>
							</div>
							
							<!-- courseTable -->
							<table class="UICourseTable">
								<thead>
									<tr>
										<td colspan="2" width="2%"></td>
										<td width="14%">星期一</td>
										<td width="14%">星期二</td>
										<td width="14%">星期三</td>
										<td width="14%">星期四</td>
										<td width="14%">星期五</td>
										<td width="14%">星期六</td>
										<td width="14%">星期天</td>
									</tr>
								</thead>
								<tbody>
									<cfloop from="1" to="6" index="lec">
										<tr>
											<cfswitch expression="#lec#">
												<cfcase value="1">
												<td rowspan="2"><cfoutput>#mathAdvice.convertLectureIdxToDayPart(lec)#</cfoutput></td>
												</cfcase>
												<cfcase value="3">
												<td rowspan="2"><cfoutput>#mathAdvice.convertLectureIdxToDayPart(lec)#</cfoutput></td>
												</cfcase>
												<cfcase value="5">
												<td rowspan="2"><cfoutput>#mathAdvice.convertLectureIdxToDayPart(lec)#</cfoutput></td>
												</cfcase>
											</cfswitch>
											<td><cfoutput>#mathAdvice.convertLectureIdxToChinese(lec)#</cfoutput></td>
											<cfloop from="1" to="7" index="wkday">
												<cfset lectureKey = "KB" & wkday & lec />
												<td <cfif timeTable[wkday][lec]>class="attention"</cfif>>
													<cfif structKeyExists( timeTableSet, lectureKey )>
														<cfset i = 0 />
														<cfloop array="#timeTableSet[lectureKey]#" index="cellCourse">
															<cfset i++ />
															<div class="lecture">
																<span class="course"><cfoutput>#cellCourse[1]#</cfoutput></span> - <span class="teacher"><cfoutput>#cellCourse[2]#</cfoutput></span>
																<br/>
																<span class="week"><cfoutput>#cellCourse[5]#</cfoutput>(<cfoutput>#cellCourse[4]#</cfoutput>)</span>
																<cfif cellCourse[3] neq "-">
																	<br/>
																	<span class="place"><cfoutput>#cellCourse[3]#</cfoutput></span>
																</cfif>
															</div>
															<cfif i lt arrayLen(timeTableSet[lectureKey]) >
																<div class="cellBreaker"><!--.--></div>
															</cfif>
														</cfloop>
													</cfif>
												</td>
											</cfloop>
										</tr>
									</cfloop>
								</tbody>
							</table>
							<!-- /courseTable -->

						</div>
					
					</cfif>
					
				</cfif>
				
			</div>
		</li>
	</ul>
</div>


